//
//  SortTableViewCell.m
//  11111
//
//  Created by lanou3g on 15/10/28.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "MenuTableViewCell.h"

//@interface  MenuTableViewCell()
//
//@property (nonatomic, strong) UIImageView *image1;
//
//@end

@implementation MenuTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubViews];
    }
    return self;
}

// 视图布局
- (void)addSubViews
{
    self.backgroudView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 20 * kWidth, 360 * kHeight)];
    self.backgroudView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.backgroudView];
    [self.contentView addSubview:self.backgroudView];
    
    self.leftImage = [[UIImageView alloc] initWithFrame:CGRectMake(5 * kWidth, 0, 200 * kHeight, 50 * kHeight)];
   // self.leftImage.backgroundColor = [UIColor brownColor];
    [self.backgroudView addSubview:self.leftImage];
    
    self.rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.leftImage.right + 20 * kWidth, 0, 100 * kWidth, 50 * kHeight)];
   // self.rightLabel.backgroundColor = [UIColor redColor];
    [self.backgroudView addSubview:self.rightLabel];
    
    self.bigButton = [[UIButton alloc] initWithFrame:CGRectMake(5 * kWidth, self.leftImage.bottom, kScreenWidth - 20 * kWidth, 235 * kHeight )];
    self.bigButton.backgroundColor = [UIColor blueColor];
    [self.backgroudView addSubview:self.bigButton];
    
    self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(5 * kWidth, self.bigButton.bottom, kScreenWidth, 60 * kHeight)];
   // self.scrollView.backgroundColor = [UIColor redColor];
    self.scrollView.contentSize = CGSizeMake(1.3 * kScreenWidth, 0);
   // self.scrollView.pagingEnabled = YES; // 整页滚动
    self.scrollView.alwaysBounceHorizontal = YES;
    self.scrollView.bounces = YES;
    [self.backgroudView addSubview:self.scrollView];
    
    self.button1 = [[UIButton alloc] initWithFrame:CGRectMake(5 * kWidth, 5 * kHeight, 85 * kWidth, 80 * kHeight)];
    self.button1.backgroundColor = [UIColor clearColor];
    self.image11 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80 * kWidth, 80 * kHeight * 0.65)];
    [self.button1 addSubview:_image11];
    [self.scrollView addSubview:self.button1];
    
    self.button2 = [[UIButton alloc] initWithFrame:CGRectMake(self.button1.right + 8 *kWidth, 5 * kHeight, 80 * kWidth, 80 * kHeight)];
    self.button2.backgroundColor = [UIColor clearColor];
    self.image21 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80 * kWidth , 80 * kHeight * 0.65)];
    [self.button2 addSubview:_image21];
    [self.scrollView addSubview:self.button2];
    
    self.button3 = [[UIButton alloc] initWithFrame:CGRectMake(self.button2.right + 8 * kWidth, 5 * kHeight, 80 * kWidth, 80 * kHeight)];
    self.button3.backgroundColor = [UIColor clearColor];
    self.image31 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80 * kWidth, 80 * kHeight * 0.65)];
    [self.button3 addSubview:_image31];
    [self.scrollView addSubview:self.button3];
    
    self.button4 = [[UIButton alloc] initWithFrame:CGRectMake(self.button3.right + 8 * kWidth, 5 * kHeight, 80 * kWidth, 80 * kHeight)];
    self.button4.backgroundColor = [UIColor clearColor];
    self.image41 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80 * kWidth, 80 * kHeight * 0.65)];
    [self.button4 addSubview:_image41];
    [self.scrollView addSubview:self.button4];
    
    self.button5 = [[UIButton alloc] initWithFrame:CGRectMake(self.button4.right + 8 * kWidth, 5 * kHeight, 80 * kWidth, 80 * kHeight * 0.65)];
    self.button5.backgroundColor = [UIColor clearColor];
    [self.scrollView addSubview:self.button5];

}



@end

